cmake_minimum_required(VERSION 3.0)

project(download)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

INCLUDE_DIRECTORIES(./)
INCLUDE_DIRECTORIES(./../)
INCLUDE_DIRECTORIES(./../../)

set(download_src_list
        ./main.cpp
        ./download_task.cpp
        ./download_file_operate.cpp
        ./download_fragment.cpp
        ./download_rate.cpp
        ./download_net_operate.cpp)

set (download_public_module_src_list
        ./../../public_module/loop_module/loop.cpp
        ./../../public_module/write_read_module/buffer.cpp
        ./../../public_module/io_reuse_module/io_epoll.cpp
        ./../../public_module/io_reuse_module/io_poll.cpp
        ./../../public_module/io_reuse_module/io_reuse_module.cpp
        ./../../public_module/protocol_center/protocol.center.cpp
        ./../../public_module/protocol_center/protocol_parser.cpp
        ./../../public_module/protocol_connection/http_protocol_operation.cpp
        ./../../public_module/protocol_connection/protocol_connection.cpp
        ./../../public_module/protocol_connection/protocol_connection_pool.cpp
        ./../../public_module/socket_module/socket_channel.cpp
        ./../../public_module/description_module/description_util.cpp
        ./../../public_module/socket_module/socket_description.cpp
        ./../../public_module/socket_module/tls_socket_connection.cpp
        ./../../public_module/socket_module/tcp_socket_connection.cpp
        ./../../public_module/socket_module/tls_socket_operate.cpp
        ./../../public_module/socket_module/udp_socket_connection.cpp
        ./../../public_module/socket_module/socket_address.cpp
        ./../../public_module/socket_module/socket_connection_util.cpp
        ./../../public_module/socket_module/tls_socket_operate.cpp
        ./../../public_module/socket_module/socket_util.cpp
        ./../../public_module/http_protocol/http_protocol_msg.cpp
        ./../../public_module/http_protocol/http_protocol_parser.cpp
        ./../../public_module/stun_protocol/stun_protocol_msg.cpp
        ./../../public_module/stun_protocol/stun_protocol_attr.cpp
        ./../../public_module/stun_protocol/stun_protocol_parser.cpp
        ./../../public_module/file_module/file_description.cpp
        ./../../public_module/file_module/file_handle.cpp
        ./../../public_module/file_module/file_operate.cpp
        ./../../public_module/timer/timer_task.cpp
        ./../../public_module/timer/timer_description.cpp
        ./../../public_module/timer/timer_channel.cpp
        ./../../public_module/base64/base64.cpp
        ./../../public_module/compress/compress.cpp
        ./../../public_module/date_util/data_util.cpp
        ./../../public_module/openssl_util/openssl_util.cpp
        ./../../public_module/string_util/string_util.cpp)

add_executable(${PROJECT_NAME} ${download_src_list} ${download_public_module_src_list})

set(libs ssl crypto pthread z)

target_link_libraries(${PROJECT_NAME} ${libs})